package main 

import "net"
import "fmt"
import "player"


func main() {
	// listen
	ta := net.TCPAddr{net.IPv4(127,0,0,1),12345}
	l,e := net.ListenTCP("tcp4",&ta)
	if e != nil {
		fmt.Println("ListenTcp err:", e)
		return
	}
	for{
		conn,e := l.AcceptTCP()
		if e == nil {
			fmt.Println("There is a new conn!")
			go player.NewReceiver(conn).Start()
		}
	}
}